#include "DXUT.h"
#include "DXUTDirect3D10Support.h"


DXUTDirect3D10Support *DXUTDirect3D10Support::GetInstance()
{
	return new DXUTDirect3D10Support();
}

DXUTDirect3D10Support::DXUTDirect3D10Support()
{
}

//--------------------------------------------------------------------------------------
// Reject any D3D10 devices that aren't acceptable by returning false
//--------------------------------------------------------------------------------------
bool DXUTDirect3D10Support::IsDeviceAcceptable( UINT Adapter, UINT Output, D3D10_DRIVER_TYPE DeviceType, DXGI_FORMAT BackBufferFormat, bool bWindowed )
{
	return true;
}

//--------------------------------------------------------------------------------------
// Create any D3D10 resources that aren't dependent on the back buffer
//--------------------------------------------------------------------------------------
HRESULT DXUTDirect3D10Support::OnCreateDevice( ID3D10Device *device, DXGI_SURFACE_DESC const *backBufferSurfaceDesc )
{
	return S_OK;
}

//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT DXUTDirect3D10Support::OnResizedSwapChain( ID3D10Device* pd3dDevice, IDXGISwapChain* pSwapChain, DXGI_SURFACE_DESC const *backBufferSurfaceDesc )
{
	return S_OK;
}

//--------------------------------------------------------------------------------------
// Render the scene using the D3D10 device
//--------------------------------------------------------------------------------------
void DXUTDirect3D10Support::OnFrameRender( ID3D10Device* pd3dDevice, double fTime, float fElapsedTime )
{
    // Clear render target and the depth stencil 
    float ClearColor[4] = { 0.176f, 0.196f, 0.667f, 0.0f };
    pd3dDevice->ClearRenderTargetView( DXUTGetD3D10RenderTargetView(), ClearColor );
    pd3dDevice->ClearDepthStencilView( DXUTGetD3D10DepthStencilView(), D3D10_CLEAR_DEPTH, 1.0, 0 );
}

//--------------------------------------------------------------------------------------
// Release D3D10 resources created in OnD3D10ResizedSwapChain 
//--------------------------------------------------------------------------------------
void DXUTDirect3D10Support::OnReleasingSwapChain()
{

}

//--------------------------------------------------------------------------------------
// Release D3D10 resources created in OnD3D10CreateDevice 
//--------------------------------------------------------------------------------------
void DXUTDirect3D10Support::OnDestroyDevice()
{

}
